package com.soft.idc.common.util;

/**
 * Copyright (c) 2011-2016, James Zhan 瑭规尝 (jfinal@126.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.Serializable;
import java.util.List;

import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

/**
 * Page is the result of Model.paginate(......) or Db.paginate(......)
 */
public class JQPage<T> implements Serializable {

	private static final long serialVersionUID = -5395997221963176643L;

	private List<Record> data; // list result of this page
	//private int draw ; // page number
//	private int iDisplayLength ; // result amount of this page
	private int recordsFiltered; // total page
	private int recordsTotal; // total row

	/**bbb
	 * Constructor.
	 * 
	 * @param list
	 *            the list of paginate result
	 * @param pageNumber
	 *            the page number
	 * @param pageSize
	 *            the page size
	 * @param totalPage
	 *            the total page of paginate
	 * @param totalRow
	 *            the total row of paginate
	 */
	public JQPage(Page<Record> page) {
		this.data = page.getList();
	//	this.draw = page.getPageNumber();
	//b	this.iDisplayLength = page.getPageSize();
		this.recordsFiltered = page.getTotalRow();
		this.recordsTotal = page.getTotalRow();
	}

	public List<Record> getData() {
		return data;
	}

	public void setData(List<Record> data) {
		this.data = data;
	}



	public void setRecordsTotal(int recordsTotal) {
		this.recordsTotal = recordsTotal;
	}



	public int getRecordsFiltered() {
		return recordsFiltered;
	}

	public void setRecordsFiltered(int recordsFiltered) {
		this.recordsFiltered = recordsFiltered;
	}

	public int getRecordsTotal() {
		return recordsTotal;
	}

	/**
	 * Return list of this page.
	 */



}
